Parse the RC string here when the first object is created rather than in
authorOwen Taylor <otaylor@redhat.com>
Sat, 2 Feb 2002 04:34:09 +0000 (04:34 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Sat, 2 Feb 2002 04:34:09 +0000 (04:34 +0000)
Fri Feb  1 23:25:33 2002  Owen Taylor  <otaylor@redhat.com>

* gtk/gtktooltips.c (gtk_tooltips_init): Parse the
RC string here when the first object is created
rather than in the class_init to not break doc
building. (#70341, Havoc Pennington.)

* gtk/gtkrc.c (parse_include_file): Use the directories
for the currently parsed files as the starting point
to look for include files. (#59975)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in
gtk/gtkrc.c
gtk/gtktooltips.c

index d82f07578f91472d2d53b49a4736d8d88bf876fb..00d7ddd45744200b6b3d8d9b22f1479c1c0e7c02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Fri Feb  1 23:25:33 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_init): Parse the
+       RC string here when the first object is created
+       rather than in the class_init to not break doc 
+       building. (#70341, Havoc Pennington.)
+
+       * gtk/gtkrc.c (parse_include_file): Use the directories
+       for the currently parsed files as the starting point
+       to look for include files. (#59975)
+
 Fri Feb  1 20:21:56 2002  Manish Singh  <yosh@gimp.org>
 
        * gtk/gtkinputdialog.c: use gtk_label_new_with_mnemonic for labels
index d82f07578f91472d2d53b49a4736d8d88bf876fb..00d7ddd45744200b6b3d8d9b22f1479c1c0e7c02 100644 (file)
@@ -1,3 +1,14 @@
+Fri Feb  1 23:25:33 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_init): Parse the
+       RC string here when the first object is created
+       rather than in the class_init to not break doc 
+       building. (#70341, Havoc Pennington.)
+
+       * gtk/gtkrc.c (parse_include_file): Use the directories
+       for the currently parsed files as the starting point
+       to look for include files. (#59975)
+
 Fri Feb  1 20:21:56 2002  Manish Singh  <yosh@gimp.org>
 
        * gtk/gtkinputdialog.c: use gtk_label_new_with_mnemonic for labels
index d82f07578f91472d2d53b49a4736d8d88bf876fb..00d7ddd45744200b6b3d8d9b22f1479c1c0e7c02 100644 (file)
@@ -1,3 +1,14 @@
+Fri Feb  1 23:25:33 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_init): Parse the
+       RC string here when the first object is created
+       rather than in the class_init to not break doc 
+       building. (#70341, Havoc Pennington.)
+
+       * gtk/gtkrc.c (parse_include_file): Use the directories
+       for the currently parsed files as the starting point
+       to look for include files. (#59975)
+
 Fri Feb  1 20:21:56 2002  Manish Singh  <yosh@gimp.org>
 
        * gtk/gtkinputdialog.c: use gtk_label_new_with_mnemonic for labels
index d82f07578f91472d2d53b49a4736d8d88bf876fb..00d7ddd45744200b6b3d8d9b22f1479c1c0e7c02 100644 (file)
@@ -1,3 +1,14 @@
+Fri Feb  1 23:25:33 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_init): Parse the
+       RC string here when the first object is created
+       rather than in the class_init to not break doc 
+       building. (#70341, Havoc Pennington.)
+
+       * gtk/gtkrc.c (parse_include_file): Use the directories
+       for the currently parsed files as the starting point
+       to look for include files. (#59975)
+
 Fri Feb  1 20:21:56 2002  Manish Singh  <yosh@gimp.org>
 
        * gtk/gtkinputdialog.c: use gtk_label_new_with_mnemonic for labels
index d82f07578f91472d2d53b49a4736d8d88bf876fb..00d7ddd45744200b6b3d8d9b22f1479c1c0e7c02 100644 (file)
@@ -1,3 +1,14 @@
+Fri Feb  1 23:25:33 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_init): Parse the
+       RC string here when the first object is created
+       rather than in the class_init to not break doc 
+       building. (#70341, Havoc Pennington.)
+
+       * gtk/gtkrc.c (parse_include_file): Use the directories
+       for the currently parsed files as the starting point
+       to look for include files. (#59975)
+
 Fri Feb  1 20:21:56 2002  Manish Singh  <yosh@gimp.org>
 
        * gtk/gtkinputdialog.c: use gtk_label_new_with_mnemonic for labels
index d82f07578f91472d2d53b49a4736d8d88bf876fb..00d7ddd45744200b6b3d8d9b22f1479c1c0e7c02 100644 (file)
@@ -1,3 +1,14 @@
+Fri Feb  1 23:25:33 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_init): Parse the
+       RC string here when the first object is created
+       rather than in the class_init to not break doc 
+       building. (#70341, Havoc Pennington.)
+
+       * gtk/gtkrc.c (parse_include_file): Use the directories
+       for the currently parsed files as the starting point
+       to look for include files. (#59975)
+
 Fri Feb  1 20:21:56 2002  Manish Singh  <yosh@gimp.org>
 
        * gtk/gtkinputdialog.c: use gtk_label_new_with_mnemonic for labels
index d82f07578f91472d2d53b49a4736d8d88bf876fb..00d7ddd45744200b6b3d8d9b22f1479c1c0e7c02 100644 (file)
@@ -1,3 +1,14 @@
+Fri Feb  1 23:25:33 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktooltips.c (gtk_tooltips_init): Parse the
+       RC string here when the first object is created
+       rather than in the class_init to not break doc 
+       building. (#70341, Havoc Pennington.)
+
+       * gtk/gtkrc.c (parse_include_file): Use the directories
+       for the currently parsed files as the starting point
+       to look for include files. (#59975)
+
 Fri Feb  1 20:21:56 2002  Manish Singh  <yosh@gimp.org>
 
        * gtk/gtkinputdialog.c: use gtk_label_new_with_mnemonic for labels
index c3a0f9aeefde85d5b73d40ce2d8a35fdbc8a4066..7295a1c7ee95ef44d0fe14513be014c5d3d4bac7 100644 (file)
@@ -1296,7 +1296,7 @@ fi
 ])
 
 AC_PATH_PROG(SGML2HTML, sgml2html, no)
-AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
+AM_CONDITIONAL(HAVE_SGML2HTML, test x$SGML2HTML != xno)
 
 AC_OUTPUT([
 config.h.win32
index 3958add6e2ed6f3f2446f18ff370dd1891f8600e..9b9e75a9c004a13c45c65c9c3eb90a5e7fdb6f81 100644 (file)
@@ -2201,6 +2201,58 @@ is_c_identifier (const gchar *string)
   return is_varname;
 }
 
+static void
+parse_include_file (GtkRcContext *context,
+                   GScanner     *scanner,
+                   const gchar  *filename)
+{
+  char *to_parse = NULL;
+  
+  if (g_path_is_absolute (filename))
+    {
+      /* For abolute paths, we call gtk_rc_parse_file unconditionally. We
+       * don't print an error in this case.
+       */
+      to_parse = g_strdup (filename);
+    }
+  else
+    {
+      /* if a relative path, we look relative to all the RC files in the
+       * include stack. We require the file to be found in this case
+       * so we can give meaningful error messages, and because on reparsing
+       * non-absolute paths don't make sense.
+       */
+      GSList *tmp_list = rc_dir_stack;
+      while (tmp_list)
+       {
+         gchar *tmpname = g_build_filename (tmp_list->data, filename, NULL);
+
+         if (g_file_test (tmpname, G_FILE_TEST_EXISTS))
+           {
+             to_parse = tmpname;
+             break;
+           }
+
+         g_free (tmpname);
+         
+         tmp_list = tmp_list->next;
+       }
+    }
+
+  if (to_parse)
+    {
+      gtk_rc_parse_file (context, to_parse, context->default_priority, FALSE);
+      g_free (to_parse);
+    }
+  else
+    {
+      g_scanner_warn (scanner, 
+                     _("Unable to find include file: \"%s\""),
+                     filename);
+    }
+
+}
+
 static guint
 gtk_rc_parse_statement (GtkRcContext *context,
                        GScanner     *scanner)
@@ -2217,7 +2269,7 @@ gtk_rc_parse_statement (GtkRcContext *context,
       token = g_scanner_get_next_token (scanner);
       if (token != G_TOKEN_STRING)
        return G_TOKEN_STRING;
-      gtk_rc_parse_file (context, scanner->value.v_string, context->default_priority, FALSE);
+      parse_include_file (context, scanner, scanner->value.v_string);
       return G_TOKEN_NONE;
       
     case GTK_RC_TOKEN_STYLE:
index 8b609a6ca8bd8cd1f7f8bb773c17f6a5090983c8..6f035292cbf18aff0945f5d08684abd045f99e24 100644 (file)
@@ -99,18 +99,24 @@ gtk_tooltips_class_init (GtkTooltipsClass *class)
   parent_class = gtk_type_class (GTK_TYPE_OBJECT);
 
   object_class->destroy = gtk_tooltips_destroy;
-
-  gtk_rc_parse_string ("style \"gtk-default-tooltips-style\" {\n"
-                      "  bg[NORMAL] = \"#ffffc0\"\n"
-                      "  fg[NORMAL] = \"#000000\"\n"
-                      "}\n"
-                      "\n"
-                      "widget \"gtk-tooltips*\" style : gtk \"gtk-default-tooltips-style\"\n");
 }
 
 static void
 gtk_tooltips_init (GtkTooltips *tooltips)
 {
+  static gboolean have_rc = FALSE;
+  if (have_rc)
+    {
+      have_rc = TRUE;
+      
+      gtk_rc_parse_string ("style \"gtk-default-tooltips-style\" {\n"
+                          "  bg[NORMAL] = \"#ffffc0\"\n"
+                          "  fg[NORMAL] = \"#000000\"\n"
+                          "}\n"
+                          "\n"
+                          "widget \"gtk-tooltips*\" style : gtk \"gtk-default-tooltips-style\"\n");
+    }
+  
   tooltips->tip_window = NULL;
   tooltips->active_tips_data = NULL;
   tooltips->tips_data_list = NULL;